package com.justech.mes.utils;



/**
 * @author feifei.li
 */
public class MaillUtils extends AbstractMailSender2 {

    private String name;

    public MaillUtils(String host, String password, String targets) {
        super(host, password, targets);
    }


    /**
     * 实例化一个对象
     *
     * @param host
     * @param password
     * @param targets
     * @return
     */
    public static MaillUtils getInstance(String host, String password, String targets) {
        return new MaillUtils(host, password, targets);
    }

    /**
     * 设置主机
     *
     * @param hostName
     * @return
     */
    public MaillUtils setHostName(String hostName) {
        this.hostName = hostName;
        return this;
    }


    /**
     * 设置主机
     *
     * @param
     * @return
     */
    public MaillUtils setName(String name) {
        this.name = name;
        return this;
    }


    /**
     * 发送邮件
     *
     * @param title
     * @param context
     * @return
     * @throws Exception
     */
    public boolean sendEmail(String title, String context) throws Exception {
        sendMail(title, context,name, null);
        return true;
    }

}
